package cn.bugstack.chatgpt.data.domain.weixin.service.factory;

import cn.bugstack.chatgpt.data.domain.weixin.service.Handler.Impl.ChatGLMMessageHandler;
import cn.bugstack.chatgpt.data.domain.weixin.service.Handler.Impl.VerificationCodeHandler;
import cn.bugstack.chatgpt.data.domain.weixin.service.Handler.MessageHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MessageHandlerFactory {

    @Resource
    private ChatGLMMessageHandler chatGLMMessageHandler;

    @Resource
    private VerificationCodeHandler verificationCodeHandler;

    public MessageHandler getMessageHandler(String message){

        if("403".equalsIgnoreCase(message)){
            return verificationCodeHandler;
        }
        return chatGLMMessageHandler;
    }
}
